import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/FormPedidoServlet")
public class FormPedido extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public FormPedido() {
		super();

	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		// Especifica o tipo de conteudo que sera enviado ao browser
		response.setContentType("text/html");

		Counter.counterAdd();

		// Criamos um STREAM com o cliente (browser)
		PrintWriter out = response.getWriter();

		out.println("<HTML>");
		out.println("<BODY>");
		out.println("<P>texto</P>");
		out.println("<P>Mais" + Counter.counter + "texto</P>");
		out.println("<P>Outro texto   " + request.getCookies() + " </P>");
		out.println("<P>Outro texto   " + request.getContextPath() + " </P>");
		out.println("<P>Outro texto   " + request.getRequestURI() + " </P>");
		out.println("</BODY>");
		out.println("</HTML>");
		out.close();

	}

}
